import Vue from 'vue'
import Router from 'vue-router'
import Home from "../views/Home.vue"
import UserList from '../components/home/UserList.vue';
import Shopmanage from '../components/home/Shopmanage.vue';
import ShopClassManage from '../components/home/ShopClassManage.vue';
import OrderManage from '../components/home/OrderManage.vue';
import OderInfo from '../components/home/OderInfo.vue';
import Login from '../views/Login.vue';
import A from '../components/home/A.vue';
import CheckProductInfo from '../components/home/product/CheckProductInfo.vue';
import EditProductInfo from '../components/home/product/EditProductInfo.vue';
import AddProduct from '../components/home/product/AddProduct.vue';
import addcategory from '../components/home/addcategory.vue';

Vue.use(Router)


export default new Router({
  routes: [
    {
      path:"/login",
      // name:"Login",
      component:Login,
      meta: {
        title: "登录"
      }
    },
    {
      path: '/',
      // name: 'Home',
      component: Home,
      meta: {
        title: "首页",
        requireAuth: true
      },
      children:[
        {
          path: "/",
          component: A,
          meta: {
            title:"首页 详细信息",
            requireAuth: true
          }
        },
        {
          path: "UserList",
          component: UserList,
          meta: {
            title: "用户列表",
            requireAuth: true
          }
        },
        {
          path: "Shopmanage",
          component: Shopmanage,
          meta: {
            title: "商品管理",
            requireAuth: true
          }
        },
        {
          path: "OrderManage",
          component: OrderManage,
          meta: {
            title: "订单管理",
            requireAuth: true
          }
        },
        {
          path: "ShopClassManage",
          component: ShopClassManage,
          meta: {
            title: "品类管理",
            requireAuth: true
          }
        },
        {
          path: "OderInfo",
          name: "OderInfo",
          component: OderInfo,
          meta: {
            title: "订单详情",
            requireAuth: true
          }
        },
        {
          path: "CheckProductInfo",
          name: "CheckProductInfo",
          component: CheckProductInfo,
          meta: {
            title: "查看商品信息",
            requireAuth: true
          }
        },
        {
          path: "EditProductInfo",
          name: "EditProductInfo",
          component: EditProductInfo,
          meta: {
            title: "修改商品信息",
            requireAuth: true
          }
        },
        {
          path: "addProduct",
          name: "addProduct",
          component: AddProduct,
          meta: {
            title: "新增商品",
            requireAuth: true
          }
        },
        {
          path: "addcategory",
          name: "addcategory",
          component: addcategory,
          meta: {
            title: "新增品类",
            requireAuth: true
          }
        },
        
      ]
    }
  ]
})
